/**
 * Selling Partner API for Listings Items
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-08-01
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { Issue } from './Issue.js'
import { ItemIdentifiersByMarketplace } from './ItemIdentifiersByMarketplace.js'

/**
 * The ListingsItemSubmissionResponse model module.
 * @module listingsitems_v2021_08_01/model/ListingsItemSubmissionResponse
 * @version 2021-08-01
 */
export class ListingsItemSubmissionResponse {
  /**
   * Constructs a new <code>ListingsItemSubmissionResponse</code>.
   * Response containing the results of a submission to the Selling Partner API for Listings Items.
   * @alias module:listingsitems_v2021_08_01/model/ListingsItemSubmissionResponse
   * @class
   * @param sku {String} A selling partner provided identifier for an Amazon listing.
   * @param status {String} The status of the listings item submission.
   * @param submissionId {String} The unique identifier of the listings item submission.
   */
  constructor (sku, status, submissionId) {
    this.sku = sku
    this.status = status
    this.submissionId = submissionId
  }

  /**
   * Constructs a <code>ListingsItemSubmissionResponse</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {ListingsItemSubmissionResponse} obj Optional instance to populate.
   * @return {ListingsItemSubmissionResponse} The populated <code>ListingsItemSubmissionResponse</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new ListingsItemSubmissionResponse()
      if (data.hasOwnProperty('sku')) { obj.sku = ApiClient.convertToType(data.sku, 'String') }
      if (data.hasOwnProperty('status')) { obj.status = ApiClient.convertToType(data.status, 'String') }
      if (data.hasOwnProperty('submissionId')) { obj.submissionId = ApiClient.convertToType(data.submissionId, 'String') }
      if (data.hasOwnProperty('issues')) { obj.issues = ApiClient.convertToType(data.issues, [Issue]) }
      if (data.hasOwnProperty('identifiers')) { obj.identifiers = ApiClient.convertToType(data.identifiers, [ItemIdentifiersByMarketplace]) }
    }
    return obj
  }
}

/**
 * A selling partner provided identifier for an Amazon listing.
 * @member {String} sku
 * @type {String}
 */
ListingsItemSubmissionResponse.prototype.sku = undefined

/**
 * Allowed values for the <code>status</code> property.
 * @enum {String}
 * @readonly
 */
ListingsItemSubmissionResponse.StatusEnum = {

  /**
     * value: "ACCEPTED"
     * @const
     */
  ACCEPTED: 'ACCEPTED',

  /**
     * value: "INVALID"
     * @const
     */
  INVALID: 'INVALID',

  /**
     * value: "VALID"
     * @const
     */
  VALID: 'VALID'
}

/**
 * The status of the listings item submission.
 * @member {String} status
 * @type {String}
 */
ListingsItemSubmissionResponse.prototype.status = undefined

/**
 * The unique identifier of the listings item submission.
 * @member {String} submissionId
 * @type {String}
 */
ListingsItemSubmissionResponse.prototype.submissionId = undefined

/**
 * Listings item issues related to the listings item submission.
 * @member {[Issue]} issues
 * @type {[Issue]}
 */
ListingsItemSubmissionResponse.prototype.issues = undefined

/**
 * Identity attributes associated with the item in the Amazon catalog, such as the ASIN.
 * @member {[ItemIdentifiersByMarketplace]} identifiers
 * @type {[ItemIdentifiersByMarketplace]}
 */
ListingsItemSubmissionResponse.prototype.identifiers = undefined
